const file = {
  state: {
    content: '',
    contentId: '',
    template: '',
    templateId: '',
    musicId: '',
    imgFile: '',
    imgUrl: ''
  },

  mutations: {
    SET_CONTENT: (state, content) => {
      state.content = content
    },
    SET_CONTENTID: (state, contentId) => {
      state.contentId = contentId
    },
    SET_TEMPLATE: (state, template) => {
      state.template = template
    },
    SET_TEMPLATEID: (state, templateId) => {
      state.templateId = templateId
    },
    SET_MUSICID: (state, musicId) => {
      state.musicId = musicId
    },
    SET_IMGFILE: (state, imgFile) => {
      state.imgFile = imgFile
    },
    SET_IMGURL: (state, imgUrl) => {
      state.imgUrl = imgUrl
    }
  },
  actions: {
    savePreview ({ commit, state }, data) {
      commit('SET_IMGURL', data.imgurl)
      commit('SET_CONTENT', data.content)
      commit('SET_CONTENTID', data.contentId)
    }
  }
}

export default file
